from utils import readExcelToOneArray, setGuoShengList
import sys

# 国盛涨幅买入
# excel路径
excel_path = r'.\excels\right.xlsx'

# raise SystemExit
try:
    # 外层循环遍历每个分组
    for group_index, group in enumerate(readExcelToOneArray(excel_path)):
        s = ''
        waitTime = 0.5
        # 循环遍历分组内的每个字典（每行数据）
        s = str(group['去除代码前缀']).zfill(6)
        print("s:", s)
        print("group:", group)
        setGuoShengList(s, [group], waitTime)

        print()  # 打印一个空行作为组之间的分隔3.5
        
except KeyboardInterrupt:
    print("\n程序被用户中断 (Ctrl+C)")
    print("正在安全退出...")
    sys.exit(0)
except Exception as e:
    print(f"程序发生错误: {e}")
    sys.exit(1)